import request from '@/utils/request'
// 获取角色,params是关于分页的信息
export const getRoleList = (params)=>request({
    url:'/sys/role',
    params
})

// 读取公司信息

export const getCompanyInfo = (companyId)=>request({
    url:`/company/${companyId}`,
})

// 删除角色
export const deleteRole = (id)=>request({url:`/sys/role/${id}`,method:'delete'})


// 实现编辑功能
export const updateRole = (data)=>request({url:`/sys/role/${data.id}`,method:'put',data});

// 获取角色详情
export const getRoleDetail = (id)=>request({url:`/sys/role/${id}`,method:"get"});


// 新增角色
export const addRole = (data)=>request({
    url: '/sys/role',
    data,
    method: 'post'
})

// 分配权限
export function assignPerm(data) {
    return request({
      url: '/sys/role/assignPrem',
      method: 'put',
      data
    })
  }